package com.isunland.managesystem.entity;

import android.content.Context;
import com.google.gson.annotations.JsonAdapter;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseModel;
import com.isunland.managesystem.base.BaseSelectObject;
import com.isunland.managesystem.utils.FullDateSeriallizer;
import com.isunland.managesystem.utils.MyStringUtil;
import java.util.ArrayList;

/**
 * 对象功能:印章使用申请表 Model对象
 * 开发公司:北京信普达系统工程有限公司
 * 开发人员:zm
 * 创建时间:2015-09-29 17:22:11
 */
@SuppressWarnings("all") public class RSealsUseApp extends BaseModel {
  // 主键
  protected String id;
  // 默认排序字段
  protected Long orderNo;
  // 默认备注字段
  protected String remark;
  // 登记人ID
  protected String regStaffId;
  // 登记人名称
  protected String regStaffName;
  // 登记人时间
  @JsonAdapter(FullDateSeriallizer.class) protected java.util.Date regDate;
  // 会员编码
  protected String memberCode;
  // 申请使用部门名称
  protected String applydeptName;
  // 申请使用部门编码
  protected String applydeptCode;
  // 申请使用时间
  @JsonAdapter(FullDateSeriallizer.class) protected java.util.Date applydeptDate;
  // 印章类别
  protected String sealsType;
  //// 印章类别名称
  //protected String sealsTypeName;
  // 印章类别编码
  protected String sealsTypeCode;
  // 申请事由
  protected String applyText;
  // 是否携带外出
  protected String isCarryOut;
  // 是否携带外出名称
  //protected String isCarryOutName;
  // 经办人
  protected String agent;
  // 经办人编码
  protected String agentCode;
  // 实际使用时间
  @JsonAdapter(FullDateSeriallizer.class) protected java.util.Date actUseDays;
  // 实际归还时间
  @JsonAdapter(FullDateSeriallizer.class) protected java.util.Date actBackDays;
  // 数据状态
  protected String dataStatus;
  //申请编号
  protected String applyNo;
  //附件名称
  protected String docBlob;
  //附件路径
  protected String docPath;
  //确认人名称
  protected String confirmName;
  //确认人编码
  protected String confirmCode;
  //确认时间
  @JsonAdapter(FullDateSeriallizer.class) protected java.util.Date confirmTime;
  protected Long runId = 0L;
  protected Long defId = 0L;
  public static final String CARRY_OUT_TRUE = "T";
  public static final String CARRY_OUT_FALSE = "F";
  // 使用途径编码
  protected String useCode;

  public String getUseCode() {
    return useCode;
  }

  public void setUseCode(String useCode) {
    this.useCode = useCode;
  }

  public String getUseName() {
    return useName;
  }

  public void setUseName(String useName) {
    this.useName = useName;
  }

  // 使用途径
  protected String useName;

  public boolean isCarryOut() {
    return MyStringUtil.equals(CARRY_OUT_TRUE, isCarryOut);
  }
  //public String getSealsTypeName() {
  //  return sealsTypeName;
  //}
  //
  //public void setSealsTypeName(String sealsTypeName) {
  //  this.sealsTypeName = sealsTypeName;
  //}

  //public String getIsCarryOutName() {
  //  return isCarryOutName;
  //}
  //
  //public void setIsCarryOutName(String isCarryOutName) {
  //  this.isCarryOutName = isCarryOutName;
  //}

  public static ArrayList<BaseSelectObject> getIsCarryOutList(Context context) {
    if (context == null) return null;
    ArrayList<BaseSelectObject> list = new ArrayList<>();
    list.add(new BaseSelectObject(null, context.getString(R.string.noLimit), ""));
    list.add(new BaseSelectObject(null, context.getString(R.string.yes), CARRY_OUT_TRUE));
    list.add(new BaseSelectObject(null, context.getString(R.string.no), CARRY_OUT_FALSE));
    return list;
  }

  public String getConfirmName() {
    return confirmName;
  }

  public void setConfirmName(String confirmName) {
    this.confirmName = confirmName;
  }

  public String getConfirmCode() {
    return confirmCode;
  }

  public void setConfirmCode(String confirmCode) {
    this.confirmCode = confirmCode;
  }

  public java.util.Date getConfirmTime() {
    return confirmTime;
  }

  public void setConfirmTime(java.util.Date confirmTime) {
    this.confirmTime = confirmTime;
  }

  public String getApplyNo() {
    return applyNo;
  }

  public void setApplyNo(String applyNo) {
    this.applyNo = applyNo;
  }

  public String getDocBlob() {
    return docBlob;
  }

  public void setDocBlob(String docBlob) {
    this.docBlob = docBlob;
  }

  public String getDocPath() {
    return docPath;
  }

  public void setDocPath(String docPath) {
    this.docPath = docPath;
  }

  /**
   * @return the defId
   */
  public Long getDefId() {
    return defId;
  }

  /**
   * @param defId the defId to set
   */
  public void setDefId(Long defId) {
    this.defId = defId;
  }

  public Long getRunId() {
    return runId;
  }

  public void setRunId(Long runId) {
    this.runId = runId;
  }

  /**
   * 返回 主键
   */
  public String getId() {
    return this.id;
  }

  public RSealsUseApp setId(String id) {
    this.id = id;
    return this;
  }

  /**
   * 返回 默认排序字段
   */
  public Long getOrderNo() {
    return this.orderNo;
  }

  public void setOrderNo(Long orderNo) {
    this.orderNo = orderNo;
  }

  /**
   * 返回 默认备注字段
   */
  public String getRemark() {
    return this.remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  /**
   * 返回 登记人ID
   */
  public String getRegStaffId() {
    return this.regStaffId;
  }

  public void setRegStaffId(String regStaffId) {
    this.regStaffId = regStaffId;
  }

  /**
   * 返回 登记人名称
   */
  public String getRegStaffName() {
    return this.regStaffName;
  }

  public void setRegStaffName(String regStaffName) {
    this.regStaffName = regStaffName;
  }

  /**
   * 返回 登记人时间
   */
  public java.util.Date getRegDate() {
    return this.regDate;
  }

  public void setRegDate(java.util.Date regDate) {
    this.regDate = regDate;
  }

  /**
   * 返回 会员编码
   */
  public String getMemberCode() {
    return this.memberCode;
  }

  public void setMemberCode(String memberCode) {
    this.memberCode = memberCode;
  }

  /**
   * 返回 申请使用部门名称
   */
  public String getApplydeptName() {
    return this.applydeptName;
  }

  public void setApplydeptName(String applydeptName) {
    this.applydeptName = applydeptName;
  }

  /**
   * 返回 申请使用部门编码
   */
  public String getApplydeptCode() {
    return this.applydeptCode;
  }

  public void setApplydeptCode(String applydeptCode) {
    this.applydeptCode = applydeptCode;
  }

  /**
   * 返回 申请使用时间
   */
  public java.util.Date getApplydeptDate() {
    return this.applydeptDate;
  }

  public void setApplydeptDate(java.util.Date applydeptDate) {
    this.applydeptDate = applydeptDate;
  }

  /**
   * 返回 印章类别
   */
  public String getSealsType() {
    return this.sealsType;
  }

  public void setSealsType(String sealsType) {
    this.sealsType = sealsType;
  }

  /**
   * 返回 印章类别编码
   */
  public String getSealsTypeCode() {
    return this.sealsTypeCode;
  }

  public void setSealsTypeCode(String sealsTypeCode) {
    this.sealsTypeCode = sealsTypeCode;
  }

  /**
   * 返回 申请事由
   */
  public String getApplyText() {
    return this.applyText;
  }

  public void setApplyText(String applyText) {
    this.applyText = applyText;
  }

  /**
   * 返回 是否携带外出
   */
  public String getIsCarryOut() {
    return this.isCarryOut;
  }

  public void setIsCarryOut(String isCarryOut) {
    this.isCarryOut = isCarryOut;
  }

  /**
   * 返回 经办人
   */
  public String getAgent() {
    return this.agent;
  }

  public void setAgent(String agent) {
    this.agent = agent;
  }

  /**
   * 返回 经办人编码
   */
  public String getAgentCode() {
    return this.agentCode;
  }

  public void setAgentCode(String agentCode) {
    this.agentCode = agentCode;
  }

  /**
   * 返回 实际使用时间
   */
  public java.util.Date getActUseDays() {
    return this.actUseDays;
  }

  public void setActUseDays(java.util.Date actUseDays) {
    this.actUseDays = actUseDays;
  }

  /**
   * 返回 实际归还时间
   */
  public java.util.Date getActBackDays() {
    return this.actBackDays;
  }

  public void setActBackDays(java.util.Date actBackDays) {
    this.actBackDays = actBackDays;
  }

  /**
   * 返回 数据状态
   */
  public String getDataStatus() {
    return this.dataStatus;
  }

  public void setDataStatus(String dataStatus) {
    this.dataStatus = dataStatus;
  }

  public String getIsCarryOutName(Context context) {
    if (context == null) return null;
    ArrayList<BaseSelectObject> result = getIsCarryOutList(context);
    if (result == null || result.size() == 0) return null;
    for (BaseSelectObject item : result) {
      if (MyStringUtil.equals(isCarryOut, item.getName())) return item.getCode();
    }
    return null;
  }
}

